privateKeyEntry

Returns the private key and certificate chain of the identity stored under alias, for use with Signature, KeyManagerFactory, or an SSLContext.

On macOS the key comes from the login keychain through the JDK KeychainStore provider, on Windows from the current-user certificate store through the JDK Windows-MY provider (the key stays non-exportable and signs through Windows), and on Linux from the PKCS#12 bundle in Secret Service.

Return

the entry, or null if alias has no entry or holds only a certificate.

Throws

if the platform has no certificate backend or the read fails.

if alias is blank or contains NUL, CR, or LF, or this store was not created by CertificateStore.forCurrentPlatform.